﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BTN04.DAO;
using BTN04.DTO;
using System.Collections.Generic;

namespace BTN04.BUS
{
    public class SanPhamBUS
    {
         public List<SanPhamDTO> DanhSachSanPhamTheoLoai(int _maLoai)
        {
            SanPhamDAO spDao = new SanPhamDAO();
            return spDao.DanhSachSanPhamTheoLoai(_maLoai);
        }

         public List<SanPhamDTO> SanPhamXemNhieuTrongNgay()
        {
            SanPhamDAO spDao = new SanPhamDAO();
            return spDao.SanPhamXemNhieuTrongNgay();
        }
        public List<SanPhamDTO> SanPhamNew()
        {
            SanPhamDAO spDao = new SanPhamDAO();
            return spDao.SanPhamNew();
        }
         public DataTable LaySanPhamTheoMa(string _maSanPham)
        {
            SanPhamDAO spDAO = new SanPhamDAO();
            return spDAO.LaySanPhamTheoMa(_maSanPham);
        }
         public List<SanPhamDTO> DanhSachSanPhamCungLoai(int _maLoai)
        {
            SanPhamDAO spDAO = new SanPhamDAO();
            return spDAO.DanhSachSanPhamCungLoai(_maLoai);
        }
         public DataTable TimKiem(SanPhamCrt spCrt)
         {
             SanPhamDAO spDAO = new SanPhamDAO();
             return spDAO.TimKiem(spCrt );
         }
        public DataTable TimKiemNangCao(string TenSanPham,int GiaTu,int GiaDen,int MaNhaSanXuat,int MaLoaiSanPham,int MaXuatSu)
        {
            SanPhamDAO spDAO = new SanPhamDAO();
            return spDAO.TimKiemNangCao(TenSanPham, GiaTu, GiaDen, MaNhaSanXuat, MaLoaiSanPham, MaXuatSu);
        }
         public int SoLuongSanPham()
        {
            SanPhamDAO spDAO = new SanPhamDAO();
            return spDAO.SoLuongSanPham();
        }
        public List<SanPhamDTO> StoreToDataSet(int currPage, int recodperpage, int Pagesize)
        {
            SanPhamDAO spDAO = new SanPhamDAO();
            return spDAO.StoreToDataSet(currPage, recodperpage, Pagesize);
        }

        public static SanPhamDTO LaySanPhamTheoMa(int masp)
        {
            return SanPhamDAO.LaySanPhamTheoMa(masp);
        }
    }
}
